const express = require("express");
// 1- 下载 cnpm i connect-history-api-fallback
const history = require("connect-history-api-fallback");
// 2- 下载 cnpm i http-proxy-middleware
const {createProxyMiddleware} = require("http-proxy-middleware");
const app = express();
app.use(history({
	index:"home.html"
}))
app.use(express.static(__dirname));
app.use("/api",createProxyMiddleware({
	target:"http://zhangpeiyue.com:8091",
	changeOrigin:true,
	pathRewrite:{
		"^/api":""
	}
}))
app.listen(80,()=>{
	console.log("success")
})